<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.jju.A1541.dao.*" 
                  import="java.util.*"
                  import="com.jju.A1541.model.*"%>
<%@ page language="java"
   contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的捐赠</title>
</head>
<body>
<div class=" col-md-8 publish wow fadeInUp" id="mydonate"><!-- 将数据appendTo tbody 定义id -->
    <div class="form-group">
    <table class="table table-bordered table-condensed table-responsive">
        <thead>
        <tr>
            <th>捐赠次数</th>
            <th>捐赠日期</th>
            <th>捐赠物品</th>
            <th>捐赠状态</th>
        </tr>
        </thead>
        <tbody >
        <%
           String keyword="";
           List<Zp> data =null;
         //区分访问该页面是直接访问 还是表单查询提交
        if(request.getParameter("keyword")==null){
       	  data =ZpDAO.getAll(); //取所有记录
        } else { //传递了关键字,根据关键字查询
       	  keyword = request.getParameter("keyword");
       	//通过String类的构造方法，指定的字符串为“UTF-8”编码
     	     keyword= new String(keyword.getBytes("ISO-8859-1"),"UTF-8");
       	  data =ZpDAO.getByKeyword(keyword);
        }
                 //遍历系统中所有的捐赠信息
                for(Zp obj:data){
                	 out.println("<tr>");
                	 out.println("<td>"+"</td>");
                	 out.println("<td>"+obj.getJzsj()+"</td>");
                	 out.println("<td>"+obj.getZplx()+"/"+obj.getQtfl()+"</td>");
                }
           %>
        </tbody>
    </table>
    </div>
</div>
</body>
</html>